# -*- coding: utf-8; mode: snippet -*-
# name: writeFile(path, 'hello', () => {})
# key: file
# contributor: Chen Bin <chenbin DOT sh AT gmail>
# --
require('fs').writeFile('${1:filepath}', $0, function(err) {
  if(err) {
    console.log('The file ${1:$(yas/substr yas-text "[^:=, ]*")} was NOT saved!', 'err=', err);
    return;
  }
  console.log('The file ${1:$(yas/substr yas-text "[^:=, ]*")} was saved!');
});